<template>
  <div class="title">
    <div @click="flag = !flag">111</div>
    <div v-show="flag" class="box">1213</div>
  </div>
</template>
<script>
import {
  trainStationList,
  getSystemTime,
  wxShareNumbersAdd,
} from '@vue/api/index';
//vuex 空间命名
// import { createNamespacedHelpers } from 'vuex'
// const { mapState, mapActions, mapGetters, mapMutations } = createNamespacedHelpers('userInfo')
import { mapState } from 'vuex';
export default {
  name: 'app',
  directives: {
    onShow: {
      // 指令的定义
      inserted: function (el, a) {
        el.style.display = a.value ? 'block' : 'none';
      },
    },
  },
  data() {
    return {
      num: 1,
      flag: false,
    };
  },
  created() {
    // this.$loading.show()
    // this.getSystemTime();
    // this.wxShareNumbersAdd()
  },
  mounted() {},
  methods: {
    wxShareNumbersAdd() {
      wxShareNumbersAdd().then((res) => {
        console.log(res);
      });
    },
    trainStationList() {
      trainStationList().then((res) => {
        console.log(res.data);
      });
    },
    getSystemTime() {
      getSystemTime().then((res) => {});
    },
  },
  computed: {
    ...mapState({
      userInfo: 'userInfo',
    }),
  },
};
</script>

<style scoped>
.title {
  font-size: 40px;
  color: red;
}

.box {
  display: flex;
}
</style>